<template>
  <div>
    御剑乘风来,除魔天地间!===home

    <input type="button" value="跳转到aa &  bb" @click="btn" />
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      name: "jack"
    };
  },
  methods: {
    btn() {
      //this.$router.push("/aa");
      //this.$router.push({ path: "/aa" });
      //this.$router.push({ name: "aaaaa" });

      //this.$router.push("/aa?name="+this.name);
      //this.$router.push(`/aa?name=${this.name}&age=18`);

      //  跳转到bb
      //this.$router.push(`/bb/${this.name}/22?hobby=游泳`);  //  /bb/jack/18

      this.$router.push({
        name: "bb",
        params: {
          name: "jack",
          age: 33
        },
        query: {
          hobby: "游泳"
        }
      }); //  /bb/jack/18
    }
  }
};
</script>
<style lang="less" scoped></style>
